﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Reporting.WinForms;

namespace SQLIOSimParser
{
    public partial class ReportViewer : Form
    {

        public ReportViewer(DataTable dtresultstable, string CustomerName, string ProjectInformation, string CustomerImagePath)
        {
            InitializeComponent();

            this.Text = "Report of result";
            reportViewer1.ProcessingMode = ProcessingMode.Local;
            reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Results", dtresultstable));
            reportViewer1.LocalReport.ReportEmbeddedResource = "SQLIOSimParser.SQLIOReport.rdlc";
            reportViewer1.LocalReport.EnableExternalImages = true;

            //Report Parameter Information
            ReportParameter paramCustomer = new ReportParameter("CustomerName",CustomerName);
            ReportParameter paramProjectInformation = new ReportParameter("ProjectInformation",ProjectInformation);
            ReportParameter paramCustomerImagePath = new ReportParameter("CustomerImagePath",CustomerImagePath);
            reportViewer1.LocalReport.SetParameters(new ReportParameter[] { paramCustomer,paramProjectInformation,paramCustomerImagePath});

            this.reportViewer1.RefreshReport();
        }

        private void ReportViewer_Load(object sender, EventArgs e)
        {
        }
    }
}
